home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #27 (Dec 87) / c daisy printer driver / mkDefault.c < prev    next >
Text File  |  1987-09-29  |  3KB  |  81 lines

  1. /*
  2.  * This function fills a print record with defaults, using coded values.
  3.  * It is used only when the default print record stored in the printer
  4.  * resource file is found to be invalid.  It's also for the code to make the 
  5.  * first copy.  According to a compile-time switch, margins are either zero
  6.  * or one inch all around, zero on the right.
  7.  * To support paper which has more than 66 lines per page or 164 columns, 
  8.  * you have to make changes here and in PDEF0.c.
  9.  */
  10. #define ONE_INCH_MARGIN 1
  11. void mkDefault(hPrint)
  12. THPrint hPrint;
  13. {
  14.     (*hPrint)->iPrVersion = VERSION;
  15.     (*hPrint)->prInfo.iDev = IDEV12;
  16.     (*hPrint)->prInfo.iVRes = VREZZ;
  17.     (*hPrint)->prInfo.iHRes = HREZZ12;
  18.     (*hPrint)->prInfo.rPage.top = 0;
  19.     (*hPrint)->prInfo.rPage.left = 0;
  20.  
  21. #if ONE_INCH_MARGIN
  22.     (*hPrint)->prInfo.rPage.right = HREZZ12 * 7;
  23.     (*hPrint)->prInfo.rPage.bottom = VREZZ * 9;
  24.     (*hPrint)->rPaper.top = -VREZZ;
  25.     (*hPrint)->rPaper.left = -HREZZ12;
  26.     (*hPrint)->rPaper.bottom = VREZZ * 10;
  27.     (*hPrint)->rPaper.right = HREZZ12 * 7 + HREZZ12/2;
  28. #else
  29.     (*hPrint)->prInfo.rPage.right = HREZZ12 * 8 + HREZZ12/2;
  30.     (*hPrint)->prInfo.rPage.bottom = VREZZ * 11;
  31.     (*hPrint)->rPaper = (*hPrint)->prInfo.rPage;
  32. #endif
  33.  
  34.     (*hPrint)->prStl.wDev = iDevDaisy;
  35.     (*hPrint)->prStl.iPageV = 11 * iPrPgFract;
  36.     (*hPrint)->prStl.iPageH = (int)((float)iPrPgFract * 8.5);
  37.     (*hPrint)->prStl.bPort = 0;
  38.     (*hPrint)->prStl.feed = feedFanfold;
  39.     (*hPrint)->prInfoPT = (*hPrint)->prInfo;
  40.     (*hPrint)->prXInfo.iRowBytes = 0;
  41.     (*hPrint)->prXInfo.iBandV = 0;
  42.     (*hPrint)->prXInfo.iBandH = 0;
  43.     (*hPrint)->prXInfo.iDevBytes = 0;
  44.     (*hPrint)->prXInfo.iBands = 0;
  45.     (*hPrint)->prXInfo.bPatScale = 0;
  46.     (*hPrint)->prXInfo.bULThick = 0;
  47.     (*hPrint)->prXInfo.bULOffset = 0;
  48.     (*hPrint)->prXInfo.bULShadow = 0;
  49.     (*hPrint)->prXInfo.scan = scanLR;
  50.     (*hPrint)->prXInfo.bXInfoX = 0;
  51.     (*hPrint)->prJob.iFstPage = 1;
  52.     (*hPrint)->prJob.iLstPage = iPrPgMax;
  53.     (*hPrint)->prJob.iCopies = 1;
  54.     (*hPrint)->prJob.bJDocLoop = bDraftLoop;
  55.     (*hPrint)->prJob.fFromUsr = TRUE;
  56.     (*hPrint)->prJob.pIdleProc = nil;
  57.     (*hPrint)->prJob.pFileName = nil;
  58.     (*hPrint)->prJob.iFileVol = 0;
  59.     (*hPrint)->prJob.bFileVers = 0;
  60.     (*hPrint)->prJob.bJobX = 0;
  61.     (*hPrint)->printX[0] =
  62.     (*hPrint)->printX[1] =
  63.     (*hPrint)->printX[2] =
  64.     (*hPrint)->printX[3] =
  65.     (*hPrint)->printX[4] =
  66.     (*hPrint)->printX[5] =
  67.     (*hPrint)->printX[6] =
  68.     (*hPrint)->printX[7] =
  69.     (*hPrint)->printX[8] =
  70.     (*hPrint)->printX[9] =
  71.     (*hPrint)->printX[10] =
  72.     (*hPrint)->printX[11] =
  73.     (*hPrint)->printX[12] =
  74.     (*hPrint)->printX[13] =
  75.     (*hPrint)->printX[14] =
  76.     (*hPrint)->printX[15] =
  77.     (*hPrint)->printX[16] =
  78.     (*hPrint)->printX[17] =
  79.     (*hPrint)->printX[18] = 0;
  80. }
  81.